<?php

class MY_Controller extends CI_Controller {

    var $_data = FALSE;
    var $container = 'container';

    public function __construct() {
        parent::__construct();

        $this->load->library('pagination');
        $this->load->library('session');
        $this->load->library('form_validation');
        $this->load->helper('language');
        $this->load->helper('text');
        $this->load->model('Admin_m');
        
    }

    function display_view($path) {
        $this->before_render();
        $this->_data['load_path'] = $path;
        $this->load->view($this->container, $this->_data);
    }

    function display_admin($path) {
        $this->before_render();
        $this->_data['load_path'] = $path;
        $this->load->view('admin/container', $this->_data);
    }

    function before_render() {
        
    }

}

class FrontEnd_Controller extends MY_Controller {

    public function __construct() {
        parent::__construct();
        $header['page'] = 'home/header';
        $footer['page'] = "home/footer";
        $sidebar['page'] = "home/side_bar";
        $this->_data['sidebar'] = $sidebar;
        $this->_data['footer'] = $footer;
        $this->_data['header'] = $header;

    }
    
    function display_view($path) {
        $this->before_render();
        $this->_data['load_path'] = $path;
        $this->load->view('container', $this->_data);
    }
    
    function before_render() {
    }
  

}

class Admin_Controller extends MY_Controller {

    public function __construct() {
        parent :: __construct();
        $header['page'] = 'admin/header';
        $footer['page'] = "admin/footer";
        $this->_data['footer'] = $footer;
        $this->_data['header'] = $header;
    }

    function before_render() {
        
    }

}

class Contact_Controller extends Admin_Controller{
	
	public function __construct(){
		parent :: __construct();
		$header['page'] = 'admin/header';
        $footer['page'] = "admin/footer";
        $this->_data['footer'] = $footer;
        $this->_data['header'] = $header;
	}
	function before_render() {
        
    }
}

class Home_Controller extends Admin_Controller{
	
	public function __construct(){
		parent :: __construct();
		$header['page'] = 'admin/header';
        $footer['page'] = "admin/footer";
        $this->_data['footer'] = $footer;
        $this->_data['header'] = $header;
	}
	function before_render() {
        
    }
}

class Aboutus_Controller extends Admin_Controller{
	
	public function __construct(){
		parent :: __construct();
		$header['page'] = 'admin/header';
        $footer['page'] = "admin/footer";
        $this->_data['footer'] = $footer;
        $this->_data['header'] = $header;
	}
	function before_render() {
        
    }
}

class Client_Controller extends Admin_Controller{
	
	public function __construct(){
		parent :: __construct();
		$header['page'] = 'admin/header';
        $footer['page'] = "admin/footer";
        $this->_data['footer'] = $footer;
        $this->_data['header'] = $header;
	}
	function before_render() {
        
    }
}

class Studio_Controller extends Admin_Controller{
	
	public function __construct(){
		parent :: __construct();
		$header['page'] = 'admin/header';
        $footer['page'] = "admin/footer";
        $this->_data['footer'] = $footer;
        $this->_data['header'] = $header;
	}
	function before_render() {
        
    }
}

class Link_Controller extends Admin_Controller{
	
	public function __construct(){
		parent :: __construct();
		$header['page'] = 'admin/header';
        $footer['page'] = "admin/footer";
        $this->_data['footer'] = $footer;
        $this->_data['header'] = $header;
        $this->load->model("Link_m");
	}
	function before_render() {
		$description = $this->Link_m->get_event_description();
		if($description){
			$this->_data['has_description'] = TRUE;
			$this->_data['event_description'] = $description;	
		}else{
			$this->_data['has_description'] = FALSE;
			$this->_data['event_description'] = "";
		}
    }
}




?>